import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget{

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'List View Widget',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('List View Widget'),
        ),
        body: Center(
          child: Container(
            height: 200,
            child: MyList()
          ),
        )
      ),
    );
  }
}

class MyList extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return ListView(
      scrollDirection: Axis.horizontal,
      children: <Widget>[
        Container(
          width: 180,
          color: Colors.lightBlue,
        ),
        Container(
          width: 180,
          color: Colors.yellow,
        ),
        Container(
          width: 180,
          color: Colors.greenAccent,
        ),
        Container(
          width: 180,
          color: Colors.red,
        ),
      ],
    );
  }
}